package org.sean.framework.pool;

/**
 * 线程池工具类
 *
 * @author Sean
 */
public final class CPUTaskExecutor extends AbstractTaskExecutor {

    private static volatile CPUTaskExecutor instance;

    private CPUTaskExecutor() {
        super(Runtime.getRuntime().availableProcessors(), "cpu");
    }

    /**
     * 获取实例
     *
     * @return CPUTaskExecutor
     */
    public static CPUTaskExecutor getInstance() {
        if (instance == null) {
            synchronized (IOTaskExecutor.class) {
                if (instance == null) {
                    instance = new CPUTaskExecutor();
                }
            }
        }
        return instance;
    }
}
